{% extends "base/_base.html" %}
{% load bootstrap3 %}
{% load static %}

{% block  title %}{{ view.model_meta.verbose_name }}{% endblock %}


{% block page-content %}

    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>信息管理</h2>
            {% include "generic/breadcrumb.html" %}
        </div>
        <div class="col-lg-2">

        </div>
    </div>


    <div class="row wrapper wrapper-content animated fadeInRight">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">

                    <h5><span class="text-success">{{ view.model_meta.verbose_name }} - {% if object %}修改{% else %}新增{% endif %}</span></h5>
                    <div class="ibox-tools">
                        <a id="return_page" class="btn btn-xs btn-danger btn-outline" style="display: none;" href="javascript:history.go(-1)">
                            <i class="fa fa-reply"></i> 返回上一页
                        </a>&nbsp;&nbsp;
                    </div>

                </div>
                <div class="ibox-content">

                    <form class="form-horizontal" method="post" enctype="multipart/form-data">
                        <!-- autocomplete="new-password" -->
                        {% csrf_token %}

                    {% block form %}
                        <!-- 表单页数据 -->
                        {% bootstrap_form form layout="horizontal" %}
                    {% endblock %}

                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit">提交</button>
                                <button class="btn btn-white" type="reset">重置</button>
                            </div>
                        </div>

                    </form>


                </div>
            </div>
        </div>

    </div>

{% endblock %}



{% block footer-js %}
    <script src="{% static  'plugins/dualListbox/jquery.bootstrap-duallistbox.js' %} "></script>
    <script>
        $(document).ready(function(){

            // 表单多对多字段设置样式, 便于多选配置
            $("form select[multiple]").bootstrapDualListbox({
                // selectorMinimalHeight: 100
            });


            // 显示返回上一页按钮
            dom = document.getElementById('return_page')
            if (dom && window.history.length > 1) {
                dom.style.display = '';
            }

        });


    </script>
{% endblock footer-js %}



